package com.jiangsong.controller;

import com.jiangsong.mq.MyMqSender;
import com.jiangsong.service.MyService;
import com.jiangsong.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/rocketmq")
public class MyController {
    @Autowired
    private MyMqSender mqProducerService;

    @Autowired
    private MyService myService;

    @Autowired
    private TestService testService;

    @GetMapping("/send")
    public String send(String mesg) {
        mqProducerService.sendMsg("test消息内容为" + mesg);
        log.info("test 消息发送成功" + mesg);
        myService.execute(mesg);
        log.info("test controller结束");
        return "消息发送成功输出" + mesg;
    }




}